﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using ISFProject.Models.DbContextInfo;
using ISFProject.Models;

namespace ISFProject.Models.DbContextInfo
{
  public class SportDbContextInitializer : DropCreateDatabaseAlways<SportDbContext>
  {
    protected override void Seed(SportDbContext context)
    {
      /*var continents = new List<Continent>
      {
        new Continent { Id=1, Name="Europ" },
        new Continent { Id=2, Name="Antartica" },
        new Continent { Id=3, Name="Africa" },
        new Continent { Id=4, Name="America" },
        new Continent { Id=5, Name="Asia" }
      };

      var countries = new List<Country>
      {
        new Country { Name="Belgium", Regio="Vlaanderen", Continent=continents.Single<Continent>(a => a.Name =="Europ") },
        new Country { Name="Belgium", Regio="Walonie", Continent=continents.Single<Continent>(a => a.Name =="Europ") },
        new Country { Name="Spain", Regio="Spain", Continent=continents.Single<Continent>(a => a.Name =="Europ") },
        new Country { Name="Netherlands", Regio="Netherland", Continent=continents.Single<Continent>(a => a.Name =="Europ") },
        new Country { Name="France", Regio="France", Continent=continents.Single<Continent>(a => a.Name =="Europ") },
        new Country { Name="Italy", Regio="Italy", Continent=continents.Single<Continent>(a => a.Name =="Europ") },
      };

      var cities = new List<City>
      {
        new City { Name="Antwerp", AreaCode=1000, Country=countries.Single<Country>(a => a.Name == "Belgium") },
        new City { Name="Amsterdam", AreaCode=2000, Country=countries.Single<Country>(a => a.Name == "Netherlands") },
        new City { Name="Madrid", AreaCode=1500, Country=countries.Single<Country>(a => a.Name == "Spain") },
        new City { Name="Paris", AreaCode=1000, Country=countries.Single<Country>(a => a.Name == "France") },
        new City { Name="Kontich", AreaCode=1000, Country=countries.Single<Country>(a => a.Name == "Belgium") },
        new City { Name="Rome", AreaCode=1000, Country=countries.Single<Country>(a => a.Name == "Italy") },
      };

      var addresses = new List<Address>
      {
      };

      var events = new List<Event>
      {
        new Event { Type=SportCategory.Swimming, Name="200m schoolslag", TimeOrLength="T", MaxResult=30 },
        new Event { Type=SportCategory.Swimming, Name="100m schoolslag", TimeOrLength="T", MaxResult=30 },
        new Event { Type=SportCategory.Swimming, Name="100m vlinderslag", TimeOrLength="T", MaxResult=30 },
        new Event { Type=SportCategory.Swimming, Name="200m vlinderslag", TimeOrLength="T", MaxResult=30 },
        new Event { Type=SportCategory.Swimming, Name="100m freestyle", TimeOrLength="T", MaxResult=30 },
        new Event { Type=SportCategory.Swimming, Name="200m freestyle", TimeOrLength="T", MaxResult=30 },
        new Event { Type=SportCategory.Swimming, Name="100m crawl", TimeOrLength="T", MaxResult=30 }
      };

      var meetings = new List<Meeting>
      {
        new Meeting { Name="competition day", TypeOfMeeting=SportCategory.Swimming, Date=new DateTime(2013, 3, 20), Location="antwerpen", IsSchoolCup=true },
        new Meeting { Name="vlaamse kampioenschap", TypeOfMeeting=SportCategory.Swimming, Date=new DateTime(2013, 4, 20), Location="kontich", IsSchoolCup=true },
        new Meeting { Name="belgische kampioenschap", TypeOfMeeting=SportCategory.Swimming, Date=new DateTime(2013, 5, 20), Location="brussel", IsSchoolCup=true },
        new Meeting { Name="waalse kampioenschap", TypeOfMeeting=SportCategory.Swimming, Date=new DateTime(2013, 6, 20), Location="namen", IsSchoolCup=true },
        new Meeting { Name="jong meet old", TypeOfMeeting=SportCategory.Swimming, Date=new DateTime(2013, 4, 15), Location="knokke", IsSchoolCup=true },
        new Meeting { Name="swimbattle", TypeOfMeeting=SportCategory.Swimming, Date=new DateTime(2013, 5, 3), Location="gent", IsSchoolCup=true },
      };

      var eventmeetings = new List<EventMeeting>
      {
      };

      var results = new List<Result>
      {
      };

      var records = new List<Record>
      {
      };*/
    }
  }
}